package edu.suda.xsap.service.impl;
import edu.suda.xsap.dto.Statistics_chargeDto;
import edu.suda.xsap.dto.Statistics_totcourseDto;
import edu.suda.xsap.dto.convert.Statistics_chargeConvert;
import edu.suda.xsap.dto.convert.Statistics_totcourseConvert;
import edu.suda.xsap.entity.Statistics_charge;
import edu.suda.xsap.entity.Statistics_totcourse;
import edu.suda.xsap.mapper.Statistics_chargeMapper;
import edu.suda.xsap.mapper.Statistics_totcourseMapper;
import edu.suda.xsap.service.Statistics_chargeService;
import edu.suda.xsap.service.Statistics_totcourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.Year;
import java.util.List;

@Service
public class Statistics_totcourseServiceImpl implements Statistics_totcourseService {

    @Autowired
    private Statistics_totcourseConvert statistics_totcourseConvert;

    @Autowired
    private Statistics_totcourseMapper statistics_totcourseMapper;

    @Override
    public List<Statistics_totcourseDto> findMONTH(Year year) {
        //
        List<Statistics_totcourse> statistics_totcourses = statistics_totcourseMapper.findMONTH(year);
        //要把这个List<s_c>转换成List<s_cDto>
        return statistics_totcourseConvert.toDtoList(statistics_totcourses);
    }

    public List<Statistics_totcourseDto> findYEAR(Year year1, Year year2) {
        //
        List<Statistics_totcourse> statistics_totcourses = statistics_totcourseMapper.findYEAR(year1, year2);
        //要把这个List<s_c>转换成List<s_cDto>
        return statistics_totcourseConvert.toDtoList(statistics_totcourses);
    }

    @Override
    public List<Statistics_totcourseDto> findQUARTER(Year year) {
        //
        List<Statistics_totcourse> statistics_totcourses = statistics_totcourseMapper.findQUARTER(year);
        //要把这个List<s_c>转换成List<s_cDto>
        return statistics_totcourseConvert.toDtoList(statistics_totcourses);
    }

}
